package airacrobats.util;

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Util class.
 */
public class SquadronWriter
{
    /**
     * @param args Main args.
     * @throws Exception Thrown if an I/O error occurs.
     */
    public static void main(String[] args) throws IOException
    {
        File file = new File("data/ef/dat/Squadron.dat");

        DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(file));

        // Writes the plane scale factor (The size in meters correnponding from 0 to 1 on the model).
        dataOutputStream.writeFloat(10.0f);
        // Writes the cruise speed of the airplane.
        dataOutputStream.writeFloat(97.0f);
        // Writes the maximum speed factor of the airplane, based on the cruise speed.
        dataOutputStream.writeFloat(1.3f);
        // Writes the maximum engine power.
        dataOutputStream.writeFloat(20.0f);
        // X axis.
        dataOutputStream.writeFloat(0.0f);
        dataOutputStream.writeFloat(-0.2f);
        dataOutputStream.writeFloat(0.0f);
        // Z axis.
        dataOutputStream.writeFloat(0.2f);
        dataOutputStream.writeFloat(-0.1f);
        dataOutputStream.writeFloat(0.0f);
        // Propeller position.
        dataOutputStream.writeFloat(0.441f);
        dataOutputStream.writeFloat(-0.028f);
        dataOutputStream.writeFloat(0.0f);
        // Number of radio sounds of the squadron.
        dataOutputStream.writeByte(9);

        dataOutputStream.close();
    }
}
